const http = uni.$u.http;
export const fetchTeldToken = () => {
  const data = {
    OperatorID: "MACFP6275",
    OperatorSecret: "abJCZunnRfZtk506",
  };
  return http.post("/backend/teld/explain/query_token", data);
};
/**
 *
 * 获取充电站信息
 * @returns
 */
export const fetchStationInfo = () => {
  const data = {
    LastQueryTime: "",
    PageNo: 1,
    PageSize: 50,
  };
  return http.post("/backend/teld/explain/query_stations_info", data, {
    params: { m2iOrgId: 1 },
  });
};

/**
 * 获取充电撞列表
 * @param {stationObj} data
 * @returns
 */
export const fetchPileList = (data) => {
  return http.post("/backend/app/charge_station_info", data, {
    params: { m2iOrgId: 1 },
  });
};

/**
 * 获取充电序列号(类似许可号)
 *
 * @returns
 */
export const fetchTeldExplainSeq = () => {
  return http.get("/backend/teld/explain/seq");
};

/**
 * 获取充电设备认证
 *
 * @returns
 */
export const fetchTeldEquipAuth = (data) => {
  return http.post("/backend/teld/explain/query_equip_auth", data);
};

/**
 * 发送充电指令
 *
 * @returns
 */
export const sendChargeCommand = (data) => {
  return http.post("/backend/teld/explain/query_start_charge", data);
};

/**
 * 获取停电序列号
 *
 * @returns
 */
export const fetchStopChargeSeq = (params) => {
  return http.get("/backend/teld/explain/stop_charge_seq", { params });
};

/**
 * 发送停电指令
 * @param data
 * @returns
 */
export const sendStopChargeCommand = (data) => {
  return http.post("/backend/teld/explain/query_stop_charge", data);
};

/**
 * 获取充电桩
 * @param {connectorInfo} data
 * @returns
 */
export const getPileDetail = (data) => {
  return http.post("/backend/app/charge_connector_detail", data, {
    params: {
      m2iOrgId: 1,
    },
  });
};

/**
 * 获取订单列表
 * @param {connectorInfo} data
 * @returns
 */
export const getOrderListByOpenId = (data) => {
  return http.post("/backend/app/order_by_openid", data);
};

// /app/order_by_openid
